pdo fetchall as object

65

pdo fetchall as object -

 <?php
 $sth = $dbh->prepare("SELECT name, colour FROM fruit");
 $sth->execute();

 $result = $q->fetchAll(PDO::FETCH_OBJ);
 //$result contains an array of stdObjects
 ?>

Comments

Submit
0 Comments